package com.blue.waffle.iwc.ui;

import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.Input.TextInputListener;
import com.badlogic.gdx.scenes.scene2d.ui.TextField;

public class CustomTextInputDialog implements TextInputListener {

	private TextField targeTextField;
	private String title;
	private String initialText;
	
	public CustomTextInputDialog(TextField targeTextField,String title, String initialText){
		this.targeTextField=targeTextField;
		this.title=title;
		this.initialText=initialText;
	}
	
	public void show(){
		Gdx.input.getTextInput(this, title, initialText);
	}
	
	@Override
	public void input(String text) {
		targeTextField.setText(text);
	}

	@Override
	public void canceled() {
		
	}
	
	public void setInitialText(String initialText) {
		this.initialText = initialText;
	}

	public void setTargeTextField(TextField targeTextField) {
		this.targeTextField = targeTextField;
	}
	
	public void setTitle(String title) {
		this.title = title;
	}
	
	public String getInitialText() {
		return initialText;
	}
	
	public TextField getTargeTextField() {
		return targeTextField;
	}
	
	public String getTitle() {
		return title;
	}
}
